<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Compose a class</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.uopz-compose" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">uopz_compose</h1>
  <p class="verinfo">(PECL uopz 1, PECL uopz 2)</p><p class="refpurpose"><span class="refname">uopz_compose</span> &mdash; <span class="dc-title">Compose a class</span></p>

 </div>

 <div id="function.uopz-compose-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function has been
<em class="emphasis">REMOVED</em> in PECL uopz 5.0.0.</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-function.uopz-compose-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>uopz_compose</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   , <span class="methodparam"><span class="type">array</span> <code class="parameter">$classes</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$methods</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$properties</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>
  ]]] ) : <span class="type"><span class="type void">void</span></span></div>

  <p class="para rdfs-comment">
 Creates a new class of the given name that implements, extends, or uses all of the provided classes
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.uopz-compose-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<code class="parameter">name</code></dt>

    <dd>

     <p class="para">
 A legal class name
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">classes</code></dt>

    <dd>

     <p class="para">
 An array of class, interface and trait names     
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">methods</code></dt>

    <dd>

     <p class="para">
 An associative array of methods, values are either closures or [modifiers =&gt; closure]
     </p>   
    </dd>
 
   
    
    <dt>
<code class="parameter">properties</code></dt>

    <dd>

     <p class="para">
 An associative array of properties, keys are names, values are modifiers
     </p>    
    </dd>

   
    
    <dt>
<code class="parameter">flags</code></dt>

    <dd>

     <p class="para">
 Entry type, by default ZEND_ACC_CLASS
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.uopz-compose-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.uopz-compose-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-564">
   <p><strong>Example #1 <span class="function"><strong>uopz_compose()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">myClass&nbsp;</span><span style="color: #007700">{}<br />trait&nbsp;</span><span style="color: #0000BB">myTrait&nbsp;</span><span style="color: #007700">{}<br />interface&nbsp;</span><span style="color: #0000BB">myInterface&nbsp;</span><span style="color: #007700">{}<br /><br /></span><span style="color: #0000BB">uopz_compose</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">Composed</span><span style="color: #007700">::class,&nbsp;[<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">myClass</span><span style="color: #007700">::class,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">myTrait</span><span style="color: #007700">::class,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">myInterface</span><span style="color: #007700">::class<br />&nbsp;&nbsp;&nbsp;&nbsp;],&nbsp;[<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"__construct"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;...&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}<br />]);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(<br />&nbsp;</span><span style="color: #0000BB">class_uses</span><span style="color: #007700">(</span><span style="color: #0000BB">Composed</span><span style="color: #007700">::class),<br />&nbsp;</span><span style="color: #0000BB">class_parents</span><span style="color: #007700">(</span><span style="color: #0000BB">Composed</span><span style="color: #007700">::class),<br />&nbsp;</span><span style="color: #0000BB">class_implements</span><span style="color: #007700">(</span><span style="color: #0000BB">Composed</span><span style="color: #007700">::class));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(1) {
  [&quot;myTrait&quot;]=&gt;
  string(7) &quot;myTrait&quot;
}
array(1) {
  [&quot;myClass&quot;]=&gt;
  string(7) &quot;myClass&quot;
}
array(1) {
  [&quot;myInterface&quot;]=&gt;
  string(11) &quot;myInterface&quot;
}
</pre></div>
   </div>
  </div>
 </div>



</div></div></div></body></html>